//
//  ImageEditorController.h
//  YuanXinCamera
//
//  Created by GJS on 2018/3/16.
//  Copyright © 2018年 晏德智. All rights reserved.
//

#import <UIKit/UIKit.h>
@protocol ImageEditorDelegate;

typedef NS_ENUM(NSInteger, ImageEditorCropViewCroppingStyle) {
    CropViewCroppingStyleDefault,     // The regular, rectangular crop box
    CropViewCroppingStyleCircular     // A fixed, circular crop box
};

@interface ImageEditorController : UIViewController

@property (nonatomic, strong) UIViewController *childEditorVC;
@property (nonatomic, strong) UIImage *image; // The image we'll be cropping
@property (nonatomic, assign) BOOL wetherAddChildEditorVC; // addChildViewController
/**
 If false, the user cannot resize the crop box frame using a pan gesture from a corner.
 Default vaue is NO.
 如果 false, 用户将不能用边角上的拖动手势来设置裁剪框大小.
 默认值是 NO.
 */
@property (nonatomic, assign) BOOL cropBoxResizeEnabled;
/**
 In relation to the coordinate space of the image, the frame that the crop view is focusing on
 */
@property (nonatomic, assign) CGRect imageCropFrame;

@property (nonatomic, weak) id<ImageEditorDelegate> editorDelegate;
// Default is YES.if set NO, the view controller don't dismiss itself.
// 默认为YES，如果设置为NO, 视图控制器将不会自己dismiss
@property(nonatomic, assign) BOOL autoDismiss;

@end


#pragma mark - Protocol
@protocol ImageEditorDelegate <NSObject>
@optional
- (void)imageEditor:(UIViewController *)editor didFinishEdittingWithImage:(UIImage *)image;
- (void)imageEditorDidCancel:(UIViewController *)editor;

@end
